home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10048 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.4 KB  |  66 lines

  1. Path: holly.ACNS.ColoState.EDU!not-for-mail
  2. From: corbyh@holly.ACNS.ColoState.EDU (Corby S. Hudnall)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Randomize
  5. Date: 5 Mar 1996 13:14:41 -0700
  6. Organization: Colorado State University, Fort Collins, CO  80523
  7. Message-ID: <4hi7bh$roe@holly.ACNS.ColoState.EDU>
  8. References: <313BD7D1.6143@IntNet.net>
  9. NNTP-Posting-Host: holly.acns.colostate.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Dave Cohoon (kahuna@IntNet.net) wrote:
  13. : (1) I cannot find a way to create a randomized int, this is one of the simplest functions in
  14. :     basic, but in C++, I have no idea. Please Help.
  15.     Look up the srand() and rand() functions, most often found in stdlib.h.  srand() 
  16. initialized the random number generator and rand spits out a pseudo random number.  To get 
  17. a specific range of random numbers, use something like this: rand()%(range+1)
  18.  
  19.  
  20. : (2) As mentioned above, I have been studying c++, I have been able comprehend the commands and
  21. :     general jist, but even after spending copious amounts of time on a chapter,and writing sample
  22. :     code to help memorize it, I find that I am still having to turn back 200 pages or so to 
  23. :     refresh myself on something.  Is this "par for the course", or am I just not cracked up to
  24. :     learn this stuff???
  25.     The learning curve is different for each of us but practicing what you are learning is 
  26. the key to becoming good at what you do.  Don't spend so much time focusing on what makes 
  27. C++ such an exceptional language when you are starting.  You can worry about classes, 
  28. templates, and general OOP techniques once you have mastered the basics.  As a general 
  29. rule, C is a much better first langauge then C++.  Take the courses that you can and with 
  30. time, you'll figure it out.
  31.  
  32.  
  33. :     I was planning on taking a few coarses when school starts back up, in hope that one day I
  34. :     might actually program professionally, but it seems like I can never learn enough to complete
  35. :     the programs I'm working on.  Is there ever an end?
  36.     The language is so enormous, I think that most professional programers keep some sort 
  37. of reference or notebook of notes that they've collected over the years.
  38.  
  39.  
  40. : P.S.----recently heard a few rumors that JAVA will probably be the future standard for the 
  41. : windows environment, Does this seem to be a true prediction, and if so, How different is it from 
  42. : C++
  43.     Beware of nasty rumors.  It's hard to say what the industry will adopt as "standard" 
  44. but with the introduction of the STL, and the MFC, I doubt that C++ will be declining in 
  45. the windows environment for quite some time.
  46.  
  47.  
  48. : Any Help would be greatly appreciated...
  49.     To give you an idea, every job I've looked at or applied for as a Software Engineer 
  50. has smiled greatly on OOP and C++.  Java is so new, it'll be years before any sort of 
  51. standard is adopted.  C++ is a good example of how long a 'standard' is hard to come by.  
  52. That's just my two cents.  BTW, feel free to ask any language questions that you have 
  53. here.  I've found this newsgroup to be a realy nice pool of information I might not have 
  54. otherwise picked up.
  55.  
  56. // ------------ BEGIN SIGNATURE ---------------
  57. #include <iostream.h>
  58. void main()
  59. {
  60.   cout<<"\aName:\tCorby S. Hudnall\n";
  61.   cout<<"School:\tColorado State University\n";
  62.   cout<<"EMail\tcorbyh@holly.colostate.edu\n";
  63.   cout<<"URL\thttp://holly.colostate.edu/~corbyh/\n";
  64. }
  65. // ------------- END SIGNATURE ----------------
  66.